package com.demo.app6.controller;

import com.demo.app6.entity.Product;
import com.demo.app6.service.ProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class HomeController {
    @Autowired
    private ProductService service;

    @GetMapping("index")
    public List<Product> index(){
        return service.getList();
    }

}
